using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace XMTAEditor
{
	public partial class ModuleLoadForm : Form
	{
		public ModuleLoadForm()
		{
			InitializeComponent();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			if (openFileDialog1.ShowDialog() == DialogResult.OK)
			{
				textBox1.Text = openFileDialog1.FileName;
				this.DialogResult = DialogResult.OK;
				Close();
			}
		}

		public string ShowDialog(string label)
		{
			label1.Text = label;
			label1.Height = label1.GetPreferredSize(new Size(label1.Width, 0)).Height;
			this.PerformLayout();
			string[] parts = label.Split(',');
			openFileDialog1.FileName = parts[0] + ".dll";
			if (DialogResult.OK == this.ShowDialog())
				return textBox1.Text;
			return null;
		}

		private void button3_Click(object sender, EventArgs e)
		{
			this.DialogResult = DialogResult.OK;
			Close();
		}
	}
}